import Vue from 'vue'

const initRegistComp = require.context('@screen', true, /^\.\/components\/[\s\S]+\.vue$/)

initRegistComp.keys().forEach(key => {
    const componentConfig = initRegistComp(key)
    const keyArr = key.split('/')
    var item = keyArr.pop() // 移除.
    item = item.split('.')[0]
    // console.log(item, componentConfig)
    Vue.component(item, componentConfig.default || componentConfig)
})